<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link href="https://cdn.bootcdn.net/ajax/libs/minireset.css/0.0.2/minireset.min.css" rel="stylesheet" />
    <title>变形动画学习</title>
  </head>
  <body>
    <style>
      main {
        width: 400px;
        height: 400px;
        border: solid 1px black;
        margin: 0 auto;
      }
      div {
        width: 100px;
        height: 100px;
        background-color: coral;
        position: relative;
        top: 50%;
        left: 50%;
        transform: translateX(-50%) translateY(-50%);
      }
      /* main:hover div {
        transform: translateX(300%);
        transition: 1s;
      } */
    </style>
    <main>
      <div></div>
    </main>
  </body>
</html>
